package com.ruoyi.project.channel.userGoodsInfo.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.channel.userGoodsInfo.mapper.UserGoodsInfoMapper;
import com.ruoyi.project.channel.userGoodsInfo.domain.UserGoodsInfo;
import com.ruoyi.project.channel.userGoodsInfo.service.IUserGoodsInfoService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 用户商品关系 服务层实现
 * 
 * @author CAIN
 * @date 2024-10-05
 */
@Service
public class UserGoodsInfoServiceImpl implements IUserGoodsInfoService 
{
	@Autowired
	private UserGoodsInfoMapper userGoodsInfoMapper;

	/**
     * 查询用户商品关系信息
     * 
     * @param orderId 用户商品关系ID
     * @return 用户商品关系信息
     */
    @Override
	public UserGoodsInfo selectUserGoodsInfoById(Long orderId)
	{
	    return userGoodsInfoMapper.selectUserGoodsInfoById(orderId);
	}
	
	/**
     * 查询用户商品关系列表
     * 
     * @param userGoodsInfo 用户商品关系信息
     * @return 用户商品关系集合
     */
	@Override
	public List<UserGoodsInfo> selectUserGoodsInfoList(UserGoodsInfo userGoodsInfo)
	{
	    return userGoodsInfoMapper.selectUserGoodsInfoList(userGoodsInfo);
	}
	
    /**
     * 新增用户商品关系
     * 
     * @param userGoodsInfo 用户商品关系信息
     * @return 结果
     */
	@Override
	public int insertUserGoodsInfo(UserGoodsInfo userGoodsInfo)
	{
	    return userGoodsInfoMapper.insertUserGoodsInfo(userGoodsInfo);
	}
	
	/**
     * 修改用户商品关系
     * 
     * @param userGoodsInfo 用户商品关系信息
     * @return 结果
     */
	@Override
	public int updateUserGoodsInfo(UserGoodsInfo userGoodsInfo)
	{
	    return userGoodsInfoMapper.updateUserGoodsInfo(userGoodsInfo);
	}

	/**
     * 删除用户商品关系对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteUserGoodsInfoByIds(String ids)
	{
		return userGoodsInfoMapper.deleteUserGoodsInfoByIds(Convert.toStrArray(ids));
	}
	
}
